<script setup name="App">
  
    import child from "@/views/components/index.vue"
  import { ref, watch } from "vue";
      var name = ref("geyao")
     var age = ref(18)
 
     const handleName = () => {
       name.value +="-" 
     };
     const handleAge = () => {
       age.value += 1
     };
     // watch(name,(newValue, oldValue) => {
     //   console.log("name", newValue, oldValue);
     // });
     // watch(age,(newValue, oldValue) => {
     //   console.log("age", newValue, oldValue);
     // });
     watch([name,age],(newValue, oldValue) => {
       console.log("all", newValue, oldValue);
     });
     </script>
     
     <template>
       <div>
         {{name}}-{{age}}
 
       </div>
       <button @click="handleName">修改姓名</button>
       <button @click="handleAge">修改年龄</button>
  
     </template>
     
     <style scoped>
     
     </style>
     
     
     
     
     